<div class="navbar navbar-fixed-top navbar-inverse">
	<div class="navbar-header">
		<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#headernavbar">
			<span class="sr-only">Toggle Navigation</span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
		</button>
          <%=link_to "Stock-Up!", dash_url, {:class=>"navbar-brand"}%>

	</div>

	<div class="navbar-collapse collapse" id="headernavbar">
		<ul class="nav navbar-nav">
			<li><%=link_to "Home", dash_url%></li>
			<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Games<b class="caret"></b></a>
				<ul class="dropdown-menu">
                         <li class="dropdown-header">Active Games</li>
                         <% @activeGames.take(3).each do |game| %>
                              <li><%=link_to (game[:name] + ((" (more on dashboard)" if @activeGames.index(game) == 2 and @activeGames.length > 3) || "")), game[:url]%></li> 
                         <%end%>
                         <li class="divider"></li>
                         <li class="dropdown-header">Pending Games</li>
                         <% @pendingGames.take(2).each do |game| %>
                              <li><%=link_to (game[:name] + ((" (more on dashboard)" if @pendingGames.index(game) == 1 and @pendingGames.length > 2) || "")), game[:url]%></li>
                         <%end%>
                         <li class="divider"></li>
                         <li class="dropdown-header">Completed Games</li>
                         <% @completedGames.take(2).each do |game| %>
                              <li><%= link_to (game[:name] + ((" (more on dashboard)" if @completedGames.index(game) == 1 and @completedGames.length > 2) || "")), game[:url]%></li>
                         <%end%>
				</ul>
			</li>
			<li><%=link_to "Stock Analysis", analytics_url%></li>
		</ul>
		<ul class="nav navbar-nav navbar-right">
			<li class="dropdown">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown">
                  <%=@current_user.username%><b class="caret"></b>
                </a>
				<ul class="dropdown-menu">
                         <li><%=link_to "Sign-out", logout_url%></li>
				</ul>
			</li>
		</ul>
	</div><!--/.nav-collapse -->
</div>
